package com.wx.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import com.wx.dao.MgrDao;
import com.wx.util.DBUtil;

public class MgrDaoImpl implements MgrDao {

	@Override
	public String mgrLogin(String username, String password) throws Exception {
		Connection conn = DBUtil.getConnection();
		PreparedStatement ps = conn.prepareStatement("select * from manage where name=? and password=?");
		ps.setString(1, username);
		ps.setString(2, password);
		ResultSet rs = ps.executeQuery();
		String user="";
		if(rs.next()){
			user=username;
		}
		
		rs.close();
		ps.close();
		conn.close();
		return user;
	}

}
